﻿
<CnGalWebSite.Components.Containers.MasaTitleContainer Icon="@IconType.Shape.ToIconString()" Title="已有作品" Class="mb-4" Collapable Outline>
    <MRow>
        @foreach (var item in Model.Texts)
        {
            <MCol Cols="12" Md="6" Class="mb-4">
                <MDCard Class="pa-4 h-100">
                    <TextCard Model="item" />
                    <div style="display:flex;justify-content: flex-end;">
                        <CnGalWebSite.Components.Buttons.MasaButton Rounded Icon="@IconType.Delete.ToIconString()" Text="删除" OnClick="@(()=>Model.Texts.Remove(item))" />
                     </div>
                 </MDCard>
             </MCol>
        }
        <MCol Cols="12" Md="6" Class="mb-4 ">
            <MDCard Class="h-100" Style="min-height: 200px;display: flex;justify-content: center;flex-direction: column;align-items: center;">
                <CnGalWebSite.Components.Buttons.MasaButton Rounded Icon="@IconType.Create.ToIconString()" Text="添加已有作品" OnClick="@(()=>Model.Texts.Add(new UserTextEditModel()))" />
             </MDCard>
         </MCol>
     </MRow>

 </CnGalWebSite.Components.Containers.MasaTitleContainer>

 @code {
    [Parameter]
    public UserEditModel Model { get; set; }

}
